<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-10 mx-auto">
		<div class="card">

			<div class="card-body">
				<div class="alert alert-info">
					1、插件显示效果举例：网站已运营：365 天 11 小时 28 分 14 秒(时、分、秒根据当前时间实时变化)。<br />
					2、插件使用的意见和建议，可添加QQ：1260361781交流。<br />
				</div>
			</div>

			<div class="card-body">
				<form action="<?php echo url('plugin-setting-mx_site_time');?>" method="post" id="form">
					<h4  class="card-title">设置展示内容</h4>

					<div class="form-group row">
						<label class="col-sm-2 form-control-label">开关：</label>
						<div class="col-sm-10">
							<?php echo $input['on_or_off'];?>
							<p class="text-grey text-small">设置开启或关闭在网站底部展示网站运营时长（安装后默认为开启）。</p>
						</div>
					</div>

					<div class="form-group row">
						<label class="col-sm-2 form-control-label">展示文字：</label>
						<div class="col-sm-10">
							<?php echo $input['display_words'];?>
							<p class="text-grey text-small">如“本站已经成功运营：”。</p>
						</div>
					</div>

					<div class="form-group row">
						<label class="col-sm-2 form-control-label">起始时间：</label>
						<div class="col-sm-10">
							<?php echo $input['current_date'];?>
							<p class="text-grey text-small">(格式举例：2018-11-08)，所填写的日期必须符合常规日期要求，且不能大于但提前日期，否则无法正常提交。</p>
						</div>
					</div>

					<p class="text-center">
						<button type="submit" class="btn btn-primary" id="submit" data-loading-text="<?php echo lang('submiting');?>...">
							<?php echo lang('confirm');?>
						</button>
					</p>

				</form>

			</div>

		</div>

	</div>

</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
	var jform = $("#form");
	var jsubmit = $("#submit");

	jform.on('submit', function() {
		jform.reset();
		var postdata = jform.serializeObject();

		jsubmit.button('loading');

		$.xpost(jform.attr('action'), postdata, function(code, message) {
			if (code == 0) {
				$.alert(message);
				jsubmit.text(message).delay(3000).location();
				return;
			} else {
				alert(message);
				jsubmit.button('reset');
			}
		});

		return false;

	});

</script>
